Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(util): add more handlers to util.open #1786

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guilhas07
Copy link

Problem:

In WSL, explorer.exe should be checked if xdg-open isn't supported.

Solution:

I thought of using vim.ui.open(), which allows for more flexibility if the user wants to override it like so:

vim.ui.open = (function(overridden)
	return function(path, opt)
		-- logic
		return overridden(path, opt)
	end
end)(vim.ui.open)

this way it would have a uniform behaviour across all vim.ui.open() invocations, and it would reduce the code duplication, but
remembered that wouldn't work due to not being present in 0.8.*.

So updated the code to resemble the upstream vim.ui.open() implementation, increasing handler support.

@guilhas07 guilhas07 changed the title feat: add more handlers to util.open feat(util): add more handlers to util.open Oct 21, 2024
Copy link
Author

@guilhas07 guilhas07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any function invocation of M.open with opts

---@param opts? {system?:boolean}
function M.open(uri, opts)

I'm curious, does it have a use case?

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant